package com.igeekhome.controller.api;

import com.igeekhome.pojo.DNetwork;
import com.igeekhome.pojo.PProblemShipment;
import com.igeekhome.pojo.SysStaff;
import com.igeekhome.service.IProblemService;
import com.igeekhome.service.IScanService;
import com.igeekhome.util.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @author 汪璇
 */
@RestController
@RequestMapping("/api/custService")
public class CustServiceControllerApi {
    
    @Autowired
    private IScanService scanService;
    
    
    @Autowired
    private IProblemService problemService;
    
    @Value("${SCANER_CLERK}")
    private Integer SCANER_CLERK;
    
    //收件扫描
    @RequestMapping("/proList")
    public ResultBean proList(HttpSession session, Integer page, Integer limit) {
        DNetwork network = (DNetwork) session.getAttribute("network");
        return scanService.proList(network, page, limit);
    }
    
    //问题件登记
    @RequestMapping("/proLogin")
    public ResultBean proLogin(PProblemShipment p, HttpSession session, Integer waybillNumber) {
        DNetwork network = (DNetwork) session.getAttribute("network");
        SysStaff staff = (SysStaff) session.getAttribute("staff");
        return problemService.proLogin(p, waybillNumber, network, staff);
    }
    
    //问题件处理列表
    @RequestMapping("/proHanderList")
    public ResultBean proHanderList(HttpSession session, Integer page,Integer limit) {
        DNetwork network = (DNetwork) session.getAttribute("network");
        return problemService.proHanderList(network,page,limit);
    }
    
    //问题件查询列表
    @RequestMapping("/proQueryList")
    public ResultBean proQueryList(HttpSession session, Integer page,Integer limit) {
        DNetwork network = (DNetwork) session.getAttribute("network");
        return problemService.proHanderList(network,page,limit);
    }
    
    //问题件处理
    @RequestMapping("/proHander")
    public ResultBean proHander(PProblemShipment p) {
        return problemService.proHander(p);
    }
    
    
}

    
